Skip to main content

Loan Origination APIs

These endpoints cover application intake, automated assessment, and bank decisioning for SME merchant loans.

Authentication

All requests require:

Authorization: Bearer demo-credify-token

1. Create Loan Application

Endpoint

POST /api/v1/loan-applications

Description

Create a new loan application for a merchant from the Credify merchant dataset.

Sample request

{
"merchant_id": "MCH-12345",
"business_name": "Tech Store LLC",
"requested_amount": 50000.0,
"loan_purpose": "inventory",
"monthly_sales_volume": 125000.0,
"platform_type": "shopify",
"requested_term_months": 12
}

Sample response

{
"application_id": "APP-2026-003",
"merchant_id": "MCH-12345",
"business_name": "Tech Store LLC",
"requested_amount": 50000.0,
"loan_purpose": "inventory",
"monthly_sales_volume": 125000.0,
"platform_type": "shopify",
"requested_term_months": 12,
"currency": "EGP",
"status": "submitted",
"created_at": "2026-04-23"
}
FieldTypeRequiredDescription
merchant_idstringYesUnique merchant identifier from the Credify merchant dataset
business_namestringYesMerchant legal business name
requested_amountdecimalYesRequested loan amount in EGP
loan_purposeenumYesinventory, working_capital, expansion, equipment
monthly_sales_volumedecimalYesAverage monthly GMV from POS or commerce channels
platform_typeenumYesshopify, woocommerce, amazon_seller
requested_term_monthsintegerYesRequested duration in months

2. Credit Assessment

Endpoint

POST /api/v1/loan-applications/{application_id}/assess

Description

Run a deterministic credit assessment against the in-memory merchant and application data.

Sample response

{
"application_id": "APP-2026-001",
"sales_performance_score": 82.5,
"business_age_months": 30,
"default_risk_rating": "low",
"recommended_amount": 46000.0,
"recommended_interest_rate": 16.5,
"assessment_notes": "Strong sales coverage relative to request. Recommend standard approval path."
}
FieldTypeDirectionDescription
application_idstringRequestLoan application reference
sales_performance_scoredecimalResponsePerformance score from 0 to 100
business_age_monthsintegerResponseMerchant operating age from fake merchant data
default_risk_ratingenumResponselow, medium, high
recommended_amountdecimalResponseSuggested lendable amount
recommended_interest_ratedecimalResponseSuggested APR
assessment_notesstringResponseSummary lending note for review

3. Loan Approval Decision

Endpoint

PUT /api/v1/loan-applications/{application_id}/decision

Description

Record the final bank decision. Approved decisions create a new loan account immediately in the fake data store.

Sample request

{
"application_id": "APP-2026-001",
"decision": "approved",
"approved_amount": 45000.0,
"interest_rate": 16.5,
"term_months": 12,
"decision_maker_id": "BANK-OFFICER-19"
}

Sample response

{
"application_id": "APP-2026-001",
"decision": "approved",
"approved_amount": 45000.0,
"interest_rate": 16.5,
"term_months": 12,
"rejection_reason": null,
"decision_maker_id": "BANK-OFFICER-19",
"loan_id": "LN-2026-002",
"status": "approved"
}
FieldTypeRequiredDescription
application_idstringYesApplication reference and must match path parameter
decisionenumYesapproved, rejected, pending_review
approved_amountdecimalIf approvedFinal approved amount
interest_ratedecimalIf approvedFinal APR
term_monthsintegerIf approvedFinal loan term
rejection_reasonstringIf rejectedRejection note
decision_maker_idstringYesBank officer or system identifier